package com.zhentao.controller;

import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.wemwdia.dto.AdChannel;
import com.zhentao.model.wemwdia.dto.SensitiveDto;
import com.zhentao.service.WmChannelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/channel")
public class WmChannelController {

    @Autowired
    private WmChannelService wmChannelService;

    @GetMapping("/channels")
    public ResponseResult findAll() {
        return wmChannelService.findAll();
    }

    @PostMapping("list")
    public ResponseResult list(@RequestBody SensitiveDto dto){
        return wmChannelService.list(dto);
    }
    @GetMapping("/del/{id}")
    public ResponseResult del(@PathVariable("id") Integer id){
        return wmChannelService.del(id);
    }
    @PostMapping("save")
    public ResponseResult save(@RequestBody AdChannel adChannel){
        return wmChannelService.save(adChannel);
    }

    @PostMapping("update")
    public ResponseResult update(@RequestBody AdChannel adChannel){
        return wmChannelService.update(adChannel);
    }



}